<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<title>SmartphoneBrainScanner2: JAMA::QR&lt; Real &gt; Class Template Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<script type="text/javascript">
  $(document).ready(initResizable);
</script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/search.js"></script>
<script type="text/javascript">
  $(document).ready(function() { searchBox.OnSelectItem(0); });
</script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectlogo"><img alt="Logo" src="sbs2_icon.png"/></td>
  <td style="padding-left: 0.5em;">
   <div id="projectname">SmartphoneBrainScanner2
   </div>
   <div id="projectbrief">A framework for building cross-platform real-time EEG applications. http://code.google.com/p/smartphonebrainscanner2/</div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.8.1.1 -->
<script type="text/javascript">
var searchBox = new SearchBox("searchBox", "search",false,'Search');
</script>
  <div id="navrow1" class="tabs">
    <ul class="tablist">
      <li><a href="index.html"><span>Main&#160;Page</span></a></li>
      <li><a href="modules.html"><span>Modules</span></a></li>
      <li><a href="namespaces.html"><span>Namespaces</span></a></li>
      <li class="current"><a href="annotated.html"><span>Classes</span></a></li>
      <li>
        <div id="MSearchBox" class="MSearchBoxInactive">
        <span class="left">
          <img id="MSearchSelect" src="search/mag_sel.png"
               onmouseover="return searchBox.OnSearchSelectShow()"
               onmouseout="return searchBox.OnSearchSelectHide()"
               alt=""/>
          <input type="text" id="MSearchField" value="Search" accesskey="S"
               onfocus="searchBox.OnSearchFieldFocus(true)" 
               onblur="searchBox.OnSearchFieldFocus(false)" 
               onkeyup="searchBox.OnSearchFieldChange(event)"/>
          </span><span class="right">
            <a id="MSearchClose" href="javascript:searchBox.CloseResultsWindow()"><img id="MSearchCloseImg" border="0" src="search/close.png" alt=""/></a>
          </span>
        </div>
      </li>
    </ul>
  </div>
  <div id="navrow2" class="tabs2">
    <ul class="tablist">
      <li><a href="annotated.html"><span>Class&#160;List</span></a></li>
      <li><a href="classes.html"><span>Class&#160;Index</span></a></li>
      <li><a href="inherits.html"><span>Class&#160;Hierarchy</span></a></li>
      <li><a href="functions.html"><span>Class&#160;Members</span></a></li>
    </ul>
  </div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
$(document).ready(function(){initNavTree('class_j_a_m_a_1_1_q_r.html','');});
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
<a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(0)"><span class="SelectionMark">&#160;</span>All</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(1)"><span class="SelectionMark">&#160;</span>Classes</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(2)"><span class="SelectionMark">&#160;</span>Namespaces</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(3)"><span class="SelectionMark">&#160;</span>Functions</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(4)"><span class="SelectionMark">&#160;</span>Variables</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(5)"><span class="SelectionMark">&#160;</span>Typedefs</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(6)"><span class="SelectionMark">&#160;</span>Enumerations</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(7)"><span class="SelectionMark">&#160;</span>Enumerator</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(8)"><span class="SelectionMark">&#160;</span>Friends</a><a class="SelectItem" href="javascript:void(0)" onclick="searchBox.OnSelectItem(9)"><span class="SelectionMark">&#160;</span>Groups</a></div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="summary">
<a href="#pub-methods">Public Member Functions</a>  </div>
  <div class="headertitle">
<div class="title">JAMA::QR&lt; Real &gt; Class Template Reference</div>  </div>
</div><!--header-->
<div class="contents">

<p><code>#include &lt;<a class="el" href="jama__qr_8h_source.html">jama_qr.h</a>&gt;</code></p>

<p><a href="class_j_a_m_a_1_1_q_r-members.html">List of all members.</a></p>
<table class="memberdecls">
<tr class="heading"><td colspan="2"><h2><a name="pub-methods"></a>
Public Member Functions</h2></td></tr>
<tr class="memitem:a16e598f3853303908c9956801b2f4f9b"><td class="memItemLeft" align="right" valign="top">&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#a16e598f3853303908c9956801b2f4f9b">QR</a> (const <a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt; &amp;A)</td></tr>
<tr class="memitem:a0cd45f70cc469e03f8042583ecc1c073"><td class="memItemLeft" align="right" valign="top">int&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#a0cd45f70cc469e03f8042583ecc1c073">isFullRank</a> () const </td></tr>
<tr class="memitem:ab4492a1039efc813b129e08d7ffd630e"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#ab4492a1039efc813b129e08d7ffd630e">getHouseholder</a> (void) const </td></tr>
<tr class="memitem:adcc1fea05c9bfbe16eca617488809320"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#adcc1fea05c9bfbe16eca617488809320">getR</a> () const </td></tr>
<tr class="memitem:af26cc81e42efdb4d46361b575e8c3f4b"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#af26cc81e42efdb4d46361b575e8c3f4b">getQ</a> () const </td></tr>
<tr class="memitem:ae21196cd1aeecad323ade468dd8d4af8"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array1_d.html">TNT::Array1D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#ae21196cd1aeecad323ade468dd8d4af8">solve</a> (const <a class="el" href="class_t_n_t_1_1_array1_d.html">TNT::Array1D</a>&lt; Real &gt; &amp;b) const </td></tr>
<tr class="memitem:a48cbe600fd6a8754a33fc382fc16d2a9"><td class="memItemLeft" align="right" valign="top"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt;&#160;</td><td class="memItemRight" valign="bottom"><a class="el" href="class_j_a_m_a_1_1_q_r.html#a48cbe600fd6a8754a33fc382fc16d2a9">solve</a> (const <a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt; &amp;B) const </td></tr>
</table>
<hr/><a name="details" id="details"></a><h2>Detailed Description</h2>
<div class="textblock"><h3>template&lt;class Real&gt;<br/>
class JAMA::QR&lt; Real &gt;</h3>

<p>Classical <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> Decompisition: for an m-by-n matrix A with m &gt;= n, the <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> decomposition is an m-by-n orthogonal matrix Q and an n-by-n upper triangular matrix R so that A = Q*R. </p>
<p>The <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> decompostion always exists, even if the matrix does not have full rank, so the constructor will never fail. The primary use of the <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> decomposition is in the least squares solution of nonsquare systems of simultaneous linear equations. This will fail if <a class="el" href="class_j_a_m_a_1_1_q_r.html#a0cd45f70cc469e03f8042583ecc1c073">isFullRank()</a> returns 0 (false).</p>
<p>The Q and R factors can be retrived via the <a class="el" href="class_j_a_m_a_1_1_q_r.html#af26cc81e42efdb4d46361b575e8c3f4b">getQ()</a> and <a class="el" href="class_j_a_m_a_1_1_q_r.html#adcc1fea05c9bfbe16eca617488809320">getR()</a> methods. Furthermore, a <a class="el" href="class_j_a_m_a_1_1_q_r.html#ae21196cd1aeecad323ade468dd8d4af8">solve()</a> method is provided to find the least squares solution of Ax=b using the <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> factors.</p>
<p>(Adapted from <a class="el" href="namespace_j_a_m_a.html">JAMA</a>, a Java Matrix Library, developed by jointly by the Mathworks and NIST; see <a href="http://math.nist.gov/javanumerics/jama">http://math.nist.gov/javanumerics/jama</a>). </p>
</div><hr/><h2>Constructor &amp; Destructor Documentation</h2>
<a class="anchor" id="a16e598f3853303908c9956801b2f4f9b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::<a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt; &amp;&#160;</td>
          <td class="paramname"><em>A</em></td><td>)</td>
          <td></td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Create a <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> factorization object for A.</p>
<dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">A</td><td>rectangular (m&gt;=n) matrix. </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="ab4492a1039efc813b129e08d7ffd630e"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt;Real&gt; <a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::getHouseholder </td>
          <td>(</td>
          <td class="paramtype">void&#160;</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Retreive the Householder vectors from <a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a> factorization </p>
<dl class="section return"><dt>Returns:</dt><dd>lower trapezoidal matrix whose columns define the reflections </dd></dl>

</div>
</div>
<a class="anchor" id="af26cc81e42efdb4d46361b575e8c3f4b"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt;Real&gt; <a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::getQ </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<pre class="fragment"> Generate and return the (economy-sized) orthogonal factor
</pre> <dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">Q</td><td>the (ecnomy-sized) orthogonal factor (Q*R=A). </td></tr>
  </table>
  </dd>
</dl>

</div>
</div>
<a class="anchor" id="adcc1fea05c9bfbe16eca617488809320"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt;Real&gt; <a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::getR </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<pre class="fragment">Return the upper triangular factor, R, of the QR factorization
</pre> <dl class="section return"><dt>Returns:</dt><dd>R </dd></dl>

</div>
</div>
<a class="anchor" id="a0cd45f70cc469e03f8042583ecc1c073"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname">int <a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::isFullRank </td>
          <td>(</td>
          <td class="paramname"></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<p>Flag to denote the matrix is of full rank.</p>
<dl class="section return"><dt>Returns:</dt><dd>1 if matrix is full rank, 0 otherwise. </dd></dl>

</div>
</div>
<a class="anchor" id="ae21196cd1aeecad323ade468dd8d4af8"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array1_d.html">TNT::Array1D</a>&lt;Real&gt; <a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_n_t_1_1_array1_d.html">TNT::Array1D</a>&lt; Real &gt; &amp;&#160;</td>
          <td class="paramname"><em>b</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<pre class="fragment">Least squares solution of A*x = b
</pre> <dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">B</td><td>m-length array (vector). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>x n-length array (vector) that minimizes the two norm of Q*R*X-B. If B is non-conformant, or if <a class="el" href="class_j_a_m_a_1_1_q_r.html#a0cd45f70cc469e03f8042583ecc1c073">QR.isFullRank()</a> is false, the routine returns a null (0-length) vector. </dd></dl>

</div>
</div>
<a class="anchor" id="a48cbe600fd6a8754a33fc382fc16d2a9"></a>
<div class="memitem">
<div class="memproto">
<div class="memtemplate">
template&lt;class Real &gt; </div>
<table class="mlabels">
  <tr>
  <td class="mlabels-left">
      <table class="memname">
        <tr>
          <td class="memname"><a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt;Real&gt; <a class="el" href="class_j_a_m_a_1_1_q_r.html">JAMA::QR</a>&lt; Real &gt;::solve </td>
          <td>(</td>
          <td class="paramtype">const <a class="el" href="class_t_n_t_1_1_array2_d.html">TNT::Array2D</a>&lt; Real &gt; &amp;&#160;</td>
          <td class="paramname"><em>B</em></td><td>)</td>
          <td> const</td>
        </tr>
      </table>
  </td>
  <td class="mlabels-right">
<span class="mlabels"><span class="mlabel">inline</span></span>  </td>
  </tr>
</table>
</div><div class="memdoc">
<pre class="fragment">Least squares solution of A*X = B
</pre> <dl class="params"><dt>Parameters:</dt><dd>
  <table class="params">
    <tr><td class="paramname">B</td><td>m x k Array (must conform). </td></tr>
  </table>
  </dd>
</dl>
<dl class="section return"><dt>Returns:</dt><dd>X n x k Array that minimizes the two norm of Q*R*X-B. If B is non-conformant, or if <a class="el" href="class_j_a_m_a_1_1_q_r.html#a0cd45f70cc469e03f8042583ecc1c073">QR.isFullRank()</a> is false, the routine returns a null (0x0) array. </dd></dl>

</div>
</div>
</div><!-- contents -->
</div><!-- doc-content -->
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="namespace_j_a_m_a.html">JAMA</a></li><li class="navelem"><a class="el" href="class_j_a_m_a_1_1_q_r.html">QR</a></li>
    <li class="footer">Generated on Fri Jun 29 2012 14:30:34 for SmartphoneBrainScanner2 by
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.1.1 </li>
  </ul>
</div>
</body>
</html>
